<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>可折叠的树形菜单</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="tree-menu">
    <ul>
        <li>
            <span class="toggle">文件夹 1</span>
            <ul class="nested">
                <li>文件 1.1</li>
                <li>文件 1.2</li>
                <li>
                    <span class="toggle">子文件夹 1.3</span>
                    <ul class="nested">
                        <li>文件 1.3.1</li>
                        <li>文件 1.3.2</li>
                    </ul>
                </li>
            </ul>
        </li>
        <li>
            <span class="toggle">文件夹 2</span>
            <ul class="nested">
                <li>文件 2.1</li>
                <li>文件 2.2</li>
            </ul>
        </li>
    </ul>
</div>
<script src="script.js"></script>
</body>
</html>